<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <link th:href="@{/common/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/common/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/common/css/animate.min.css}" rel="stylesheet"/>
    <link th:href="@{/common/css/style.min.css}" rel="stylesheet"/>
    <!-- CSS -->
    <link th:href="@{/vendor/datatables/dataTables.bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/content.css}" rel="stylesheet">

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>购买订单管理</h5>

            <div class="ibox-tools">
                 <a   th:href="@{'/ordersales/toCreate'} ">
                     <i class="fa fa-plus"></i>新增订单
                 </a>
            </div>
        </div>
        <div class="ibox-content" id="container">

            <form class="form-horizontal" id="query-order-form">

                <div class="form-group">
                    <label class="col-sm-1 control-label">企业名称：</label>

                    <div class="col-sm-2">
                        <select class="form-control" id="selectCompanyId" name="companyId">
                            <option th:each="company,companyStat:${companyList}"
                                    th:value="${company.id}" th:text="${company.companyName}"></option>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label">订单号：</label>

                    <div class="col-sm-2">
                        <input type="text" class="form-control focus" placeholder="订单号"/>
                    </div>
                    <div class="col-sm-offset-1 col-sm-1">
                        <button class="btn btn-w-m btn-primary" type="button"
                                id="btn-query-order">查&nbsp;&nbsp;&nbsp;询
                        </button>
                    </div>

                </div>
            </form>

            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper form-inline" role="grid">
                <table class="table table-bordered table-hover dataTable table-striped width-full text-nowrap"
                       id="DataTables_order_sales" aria-describedby="DataTables_Table_0_info" data-plugin="dataTable">
                    <thead>
                    <tr role="row">
                        <th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1"
                            colspan="1" aria-label="订单号：激活排序列升序" style="width: 200px;">
                            订单号
                        </th>
                        <th class="sorting" tabindex="1" aria-controls="DataTables_Table_0" rowspan="1"
                            colspan="1" aria-label="订单号：激活排序列升序" style="width: 200px;">
                            金额
                        </th>
                        <th class="sorting" tabindex="2" aria-controls="DataTables_Table_0" rowspan="1"
                            colspan="1" aria-label="马币抵扣金额：激活排序列升序" style="width: 200px;">
                            马币抵扣金额
                        </th>
                        <th class="sorting" tabindex="3" aria-controls="DataTables_Table_0" rowspan="1"
                            colspan="1" aria-label="用户名称：激活排序列升序" style="width: 100px;">用户名称
                        </th>
                        <th class="sorting" tabindex="4" aria-controls="DataTables_Table_0" rowspan="1"
                            colspan="1" aria-label="订单状态：激活排序列升序" style="width: 100px;">订单状态
                        </th>
                        <th class="sorting_desc" tabindex="5" aria-controls="DataTables_Table_0" rowspan="1"
                            colspan="1" aria-label="下单时间：激活排序列升序" style="width: 100px;">下单时间
                        </th>
                        <th class="sorting" tabindex="6" aria-controls="DataTables_Table_0" rowspan="1"
                            colspan="1" aria-label="" style="width: 300px;">操作
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="gradeA odd" th:each="order,orderStat:${simpleOrderList}">
                        <td class="sorting_1" th:text="${order.orderNo}"></td>
                        <td class="" th:text="${order.amount}">魏总</td>
                        <td class="center " th:if="${order.orderExtDto!=null}" th:text="${order.orderExtDto.mbAmount}">021-88888888</td>
                        <td class="center " th:unless="${order.orderExtDto!=null}" >0</td>
                        <td class="center " th:text="${order.userName}">美盛路768号</td>
                        <td class="center " th:text="${order.statusDesc}"></td>
                        <td class="center " th:text="${order.createAtStr}"></td>
                        <td class="center ">
                            <input type="hidden" th:value="${order.orderNo}">
                            <a class="btn btn-primary btn-detail"
                               th:href="@{'/ordersales/findOrderDetail/'+${order.orderNo} } ">查看明细</a>
                              <a class="btn btn-danger btn-detail-cancel" th:if="${order.status=='0'}">取消</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!-- JS -->
<script type="text/javascript" th:src="@{/common/js/jquery-3.1.1.min.js}"></script>
<script type="text/javascript" th:src="@{/common/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/vendor/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/vendor/datatables/jquery.dataTables.min.js}"></script>
<script type="text/javascript" th:src="@{/vendor/datatables/dataTables.bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/js/Utils.js}"></script>
<script type="text/javascript" th:src="@{/js/alert.js}"></script>
<script type="text/javascript" th:src="@{/js/order.js}"></script>
</body>
</html>
